// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------
// Modification history:
// feature: Code style modification
// ------------------------------------------------------------------

#ifndef XMLPARSER_QOS_PUBLISHERQOS_HPP_
#define XMLPARSER_QOS_PUBLISHERQOS_HPP_

#include <xmlparser/qos/XMLQosPolicies.hpp>
#include <xmlparser/attributes/XMLPublisherAttributes.h>

namespace vbsutil {
namespace xmlparser {

/**
 * Class PublisherQos, containing all the possible Qos that can be set for a determined Publisher.
 * Although these values can be set and are transmitted
 * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been
 * implemented in the library.
 * Please consult each of them to check for implementation details and default values.
 *
 * @ingroup EDDS_QOS_MODULE
 */
class PublisherQos {
 public:
    /**
     * @brief Constructor
     */
    RTPS_DllAPI PublisherQos() {}

    /**
     * @brief Destructor
     */
    RTPS_DllAPI virtual ~PublisherQos() = default;

    bool operator==(const PublisherQos& b) const { return (this->partition_ == b.partition()); }

    /**
     * Getter for PartitionQosPolicy
     *
     * @return PartitionQosPolicy reference
     */
    const PartitionQosPolicy& partition() const { return partition_; }

    /**
     * Getter for PartitionQosPolicy
     *
     * @return PartitionQosPolicy reference
     */
    PartitionQosPolicy& partition() { return partition_; }

    /**
     * Setter for PartitionQosPolicy
     *
     * @param partition PartitionQosPolicy
     */
    void partition(const PartitionQosPolicy& partition) { partition_ = partition; }

 private:
    //! Partition Qos, implemented in the library.
    PartitionQosPolicy partition_;
};

// RTPS_DllAPI extern const PublisherQos PUBLISHER_QOS_DEFAULT;

const PublisherQos& getDefaultPublisherQos();

}  // namespace xmlparser
}  // namespace vbsutil

#endif
